package com.aspose.cells;

class znl {
   String a = null;
   boolean b;
   String c = null;
   private int f = 0;
   private boolean g = false;
   private int h = 0;
   private boolean i = false;
   private int j;
   int d;
   int e;
   private byte k;

   public int a() {
      return this.f;
   }

   public void a(int var1) {
      this.f = var1;
      this.e(28);
   }

   public boolean b() {
      return this.g;
   }

   public void a(boolean var1) {
      this.g = var1;
      this.e(29);
   }

   public int c() {
      return this.h;
   }

   public void b(int var1) {
      this.h = var1;
      this.e(27);
   }

   public boolean d() {
      return this.i;
   }

   public void b(boolean var1) {
      this.i = var1;
      this.e(30);
   }

   public int e() {
      return this.j;
   }

   public void c(int var1) {
      this.j = var1;
      this.e(31);
   }

   private boolean d(int var1) {
      switch(var1) {
      case 27:
         return (this.k & 255 & 2) != 0;
      case 28:
         return (this.k & 255 & 4) != 0;
      case 29:
         return (this.k & 255 & 1) != 0;
      case 30:
         return (this.k & 255 & 8) != 0;
      case 31:
         return (this.k & 255 & 16) != 0;
      default:
         return false;
      }
   }

   private void e(int var1) {
      switch(var1) {
      case 27:
         this.k = (byte)(this.k | 2);
         break;
      case 28:
         this.k = (byte)(this.k | 4);
         break;
      case 29:
         this.k = (byte)(this.k | 1);
         break;
      case 30:
         this.k = (byte)(this.k | 8);
         break;
      case 31:
         this.k = (byte)(this.k | 16);
      }

   }

   boolean a(znl var1) {
      return com.aspose.cells.b.a.zv.b(this.a, var1.a) && com.aspose.cells.b.a.zv.b(this.c, var1.c) && this.b() == var1.b() && this.d() == var1.d() && this.a() == var1.a() && this.e() == var1.e();
   }

   void a(Style var1, boolean var2) {
      if (this.a != null) {
         var1.setHorizontalAlignment(zase.k(this.a));
      }

      if (this.b) {
         var1.setJustifyDistributed(true);
      }

      if (this.c != null) {
         var1.setVerticalAlignment(zase.l(this.c));
      }

      if (this.d(27)) {
         if (var2) {
            var1.c(this.c());
         } else {
            var1.setIndentLevel(this.c());
         }
      }

      if (this.d(29)) {
         var1.setTextWrapped(this.b());
      }

      if (this.d(30)) {
         var1.setShrinkToFit(this.d());
      }

      if (this.d(28)) {
         if (this.a() != 255 && this.a() > 90) {
            var1.setRotationAngle(90 - this.a());
         } else {
            var1.setRotationAngle(this.a());
         }
      }

      if (this.d(31)) {
         var1.setTextDirection(this.e());
      }

   }

   static znl a(Style var0) {
      boolean var1 = var0.l();
      if (!var1 && var0.h() > 0 && var0.h() < var0.e().B().getCount()) {
         Style var2 = var0.e().B().a(var0.h());
         var1 = var2.l();
      }

      if (var1) {
         znl var4 = new znl();
         if (var0.isModified(25)) {
            var4.a = zase.i(var0.getHorizontalAlignment());
         }

         if (var0.isJustifyDistributed()) {
            var4.b = true;
         }

         if (var0.isModified(26)) {
            var4.c = zase.j(var0.getVerticalAlignment());
         }

         int var3 = var0.getRotationAngle();
         if (var3 >= 0) {
            var4.a(var3);
         } else {
            var4.a(90 - var3);
         }

         var4.a(var0.isTextWrapped());
         var4.b(var0.getIndentLevel());
         var4.b(var0.getShrinkToFit());
         var4.c(var0.getTextDirection());
         var4.d = var0.getHorizontalAlignment();
         var4.e = var0.getVerticalAlignment();
         return var4;
      } else {
         return null;
      }
   }
}
